<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 100px;
            border: 5px solid #000;
            /* display: flex; */
            overflow: hidden;
        }
        .bannerbox{
            width: 800px;
            height: 100px;
            display: flex;
        }
        .banner{
            /* float: left; */
            width: 200px;
            height: 100px;
            background-color: red;
            animation: bnr 10s ease-in-out 2s infinite;
        }
        .banner:nth-child(2){
            background-color: green;
        }
        .banner:nth-child(3){
            background-color:blue;
        }
        .banner:nth-child(4){
            background-color:pink;
        }
        @keyframes bnr{
            0%{
                transform: translate(0);
            }          
            10%{
                transform: translate(-200px);
            }  
            20%{
                transform: translate(-200px);
            }
            30%{
                transform: translate(-400px);
            }
            40%{
                transform:translate(-400px);
            }
            50%{
                transform:translate(-600px);
            }
            60%{
                transform:translate(-400px);
            }
            70%{
                transform:translate(-400px);
            }
            80%{
                transform:translate(-200px);
            }
            90%{
                transform:translate(-200px);
            }
            100%{
                transform:translate(0);
            }
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="bannerbox">
            <div class="banner"></div>
            <div class="banner"></div>
            <div class="banner"></div>
            <div class="banner"></div>
        </div>

    </div>
</body>
</html>